<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let appointment ={
            flowers:'碎冰蓝玫瑰',
            eat:'烤肉',
            movie:'山海经',
            games:function (state){
                console.log(`${state}打游戏`);
            }
        }
        console.log(appointment);

        // 1.获取对象属性的两种方式
        // 对象名.属性名
        // 对象名[字符串]字符串是属性名
        console.log(appointment.flowers);
        console.log(appointment['eat']);

        // 2.变量是window 的属性
        var age =22;
        let state;

        // 3.window一般省略
        console.log(age);
        console.log(window.age);

        // 4.对象方法的调用
        appointment.games();
        appointment.games('晚上');

        function play(){
            console.log('玩抖音');
        }
        play();
        window.play();


        // 5.对象可以动态的添加属性（方法）
        appointment.shopping='买零食';
        appointment.play=function (){
            console.log('玩抖音');
        }
        console.log(appointment.shopping);
        appointment.play();

        // 6.属性的修改（变量的重新赋值）
        appointment.flowers='白玫瑰';
        console.log(appointment);

        // 7.属性的删除delete对象名.属性名
        delete appointment.flowers;
        console.log(appointment);
    </script>
</body>
</html>